<?php

namespace App\Http\Requests;

/**
 * 微信图片素材-保存验证类
 * @package App\Http\Requests
 */
class AdminWxMaterialImagePost extends AdminBaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required',
            'is_forever' => 'required|in:0,1',
            'view_url' => 'required|url'
        ];
    }

    /**
     * 设定验证提示文字
     * @return array
     */
    public function messages()
    {
        return [
            'title.required' => '请输入素材名称',
            'is_forever.required' => '请选择素材类型',
            'is_forever.in' => '请选择有效的素材类型',
            'view_url.required' => '请上传素材',
            'view_url.url' => '请上传素材',
        ];
    }
}
